package com.tcd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tcd.pojo.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 角色表 Mapper 接口
 * </p>
 *
 * @author space
 * @since 2021-05-21
 */
public interface RoleMapper extends BaseMapper<Role> {
    List<Role> selectRoleFilter(@Param("pageIndex") Integer pageIndex,@Param("pageSize")  Integer pageSize,@Param("name") String name,@Param("permissionId") Integer permissionId);

    Integer selectRoleFilterCount(@Param("name") String name, @Param("permissionId") Integer permissionId);

    Integer insertRolePermission(@Param("roleId") Integer roleId,@Param("permissionIds") Integer[] permissionIds);

    Integer deleteRolePermission(Integer roleId);

    List<Role> selectUserRole(Integer uid);

    List<Role> selectUserGroupRole(Integer groupId);

    Role selectRoleById(Integer roleId);
}
